﻿<Page
    x:Class="MJPEGDecoderWinRT.View.ViewCameraPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MJPEGDecoderWinRT.View"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    DataContext="{Binding DefaultViewModel.Root, RelativeSource={RelativeSource Self}}"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0"
                    Orientation="Horizontal"
                    Margin="12,12,0,0">
            <TextBlock Text="camera:"
                       FontSize="14"
                       Width="60" />
            <TextBlock Text="{Binding Camera.Name}"
                       FontSize="14"/>
        </StackPanel>
        <StackPanel Grid.Row="1"
                    Orientation="Horizontal"
                    Margin="12,0,0,0">
            <TextBlock Text="uri:"
                       FontSize="14"
                       Width="60" />
            <TextBlock Text="{Binding RequestUri}"
                       FontSize="14"/>
        </StackPanel>
        <StackPanel Grid.Row="2"
                    Orientation="Horizontal"
                    Margin="12,0,0,24">
            <TextBlock Text="fps:"
                       FontSize="14"
                       Width="60" />
            <TextBlock Text="{Binding FPS}"
                       FontSize="14"/>
        </StackPanel>
        <Image Grid.Row="3"
               x:Name="CameraImage"
               Source="{Binding CameraBitmap}"
               Stretch="UniformToFill" />
        <TextBlock Grid.Row="4"
                   Text="{Binding ErrorMsg}"
                   Margin="12,0,0,12"
                   FontSize="16"
                   Foreground="Red"
                   TextWrapping="Wrap"/>
    </Grid>
    
</Page>
